<?php
/**
 * @copyright meila.com
 * @author wangtao5@
 * @name 
 * @param 
 *         $xxx = 作用
 * @static 
 *         XXX = 作用
 * 
 * 
 */

class ml_tool_lbTag
{
    static function tgidDecode($tgid)
    {
        $sTgid = (string)$tgid;
        return array(
            'tag_group_id' => substr($sTgid , 0 , 4),
            'tag_id' => substr($sTgid , 4)
        );
    }
    static function tgidEncode($group_id , $tag_id)
    {
        $group_id = (int)$group_id;
        if($group_id<=9999 && $group_id>1000)
        {
            return (string)$group_id.(string)$tag_id;
        }
        return false;
    }

    static function tagid2str($tag_id)
    {
        return base_convert($tag_id , 10 , 36);
    }
}
?>